package com.bw.doctor.controller;
/**
 * @Author：尚志豪
 * @Package：com.bw.system.controller
 * @Project：doudi-group2-shixun-02
 * @name：PrivateDoctorController
 * @Date：2025/2/24 20:52
 */

import com.bw.common.core.domain.R;
import com.bw.common.core.web.controller.BaseController;
import com.bw.doctor.service.PrivateDoctorService;
import com.bw.domain.ConsultationRecord;
import com.bw.domain.Patient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: doudi-group2-shixun-02
 * @description: 私人医生管理
 * @author: CuiFu Bo
 * @create: 2025-02-24 20:52
 **/
@RestController
@RequestMapping("/privateDoctor")
public class PrivateDoctorController extends BaseController
{
    @Autowired
    private PrivateDoctorService privateDoctorService;
    /**
     * 查询问诊服务
     */
    @PostMapping("/checkByLoginDoctorId")
    public List<com.bw.domain.Patient> checkByLoginDoctorId(@RequestParam Long doctorId, @RequestParam Long state)
    {

        List<com.bw.domain.Patient> list = privateDoctorService.checkByLoginDoctorId(doctorId, state);
        return list;
    }

    /**
     * 通过患者问诊id查询详情
     */
    @PostMapping("/queryPatientInformationByPatientId/{patientId}")
    public R<Patient> queryPatientInformationByPatientId(@PathVariable Long patientId)
    {
        System.out.println("patientId:" + patientId);
        com.bw.domain.Patient patient = privateDoctorService.queryPatientInformationByPatientId(patientId);
        System.out.println("patient: " + patient);
        return R.ok(patient);
    }

    /**
     * 通过患者问诊id查询问诊记录
     */
    @PostMapping("/queryTheConsultationRecordByThePatientsConsultationId/{patientId}")
    public R<List<ConsultationRecord>> queryTheConsultationRecordByThePatientsConsultationId(@PathVariable Long patientId)
    {
        List<com.bw.domain.ConsultationRecord> consultationRecordList = privateDoctorService.queryTheConsultationRecordByThePatientsConsultationId(patientId);
        return R.ok(consultationRecordList);
    }

}



